# Maintainer: Michael Aldridge <maldridge@voidlinux.org>
pkgname=musl-nscd
pkgver=1.0.3
pkgrel=0
pkgdesc="Implementation of nscd for nsswitch modules for musl"
url="https://github.com/pikhq/musl-nscd"
arch="all"
license="MIT"
depends_dev="bison flex"
makedepends="$depends_dev"
install="$pkgname.pre-install $pkgname.post-deinstall"
subpackages="$pkgname-dev $pkgname-doc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/pikhq/musl-nscd/archive/v$pkgver.tar.gz
	musl-nscd.initd
	"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

package() {
	make DESTDIR="$pkgdir" install

	install -m644 -D include/nss.h \
		"$pkgdir"/usr/include

	install -m644 -D COPYRIGHT \
		"$pkgdir"/usr/share/licenses/$pkgname/COPYRIGHT

	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/nscd
}

sha512sums="b931a28d70bbcc19a5b592449e7400ee61d5af93511d44e2e63416010b3938f1d350a965b0ad876699bed406926d3180a0380868279e13d3456e2264c80a4b7d  musl-nscd-1.0.3.tar.gz
d66265b6e4f15d330282eb57a0e58860d49e24656a90bb7fe0360fdeecb0a0f0d411e9c21da16f0ceadace0523d994398d64e9dc60aaf3734c4d0aab3b8ae73f  musl-nscd.initd"
